<?xml version="1.0" encoding="iso-8859-1"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
  <html xmlns="http://www.w3.org/1999/xhtml">
		<head>
			<!-- template designed by Marco Von Ballmoos -->
			<title>Docs For Class Psa_Plugin_View</title>
			<link rel="stylesheet" href="../../media/stylesheet.css" />
			<meta http-equiv='Content-Type' content='text/html; charset=iso-8859-1'/>
		</head>
		<body>
			<div class="page-body">			
<h2 class="class-name"><img src="../../media/images/AbstractClass_logo.png"
														alt="Abstract Class"
														title="Abstract Class"
														style="vertical-align: middle"> Psa_Plugin_View</h2>

<a name="sec-description"></a>
<div class="info-box">
	<div class="info-box-title">Description</div>
	<div class="nav-bar">
					<span class="disabled">Description</span> |
													<a href="#sec-var-summary">Vars</a> (<a href="#sec-vars">details</a>)
						|											<a href="#sec-method-summary">Methods</a> (<a href="#sec-methods">details</a>)
						
					</div>
	<div class="info-box-body">
        		<!-- ========== Info from phpDoc block ========= -->
<p class="short-description">Abstract class for plugins type of <em>Psa_Plugin_View</em>.</p>
<p class="description"><p>View plugins (classes that extends Psa_Plugin_View class) are place for for methods that will  generate and display result from your application. This can be HTML, XML or something else.  View methods, like model methods, are called from controller. All application logic should  be in model and in view you should put only part for displaying results like template rendering code.</p><p>You can organize your view methods into more view classes to be logically grouped.</p><p>You can write <em>Psa_Plugin_View</em> plugins by extending this class. Here is an example:</p><p><div class="src-code"><ol><li><div class="src-line">&nbsp;<span class="src-php">&lt;?php</span></div></li>
<li><div class="src-line">&nbsp;<span class="src-key">class&nbsp;</span><span class="src-id">example_view&nbsp;</span><span class="src-key">extends&nbsp;</span><a href="../../psa/plugins/Psa_Plugin_View.html">Psa_Plugin_View</a><span class="src-sym">{</span></div></li>
<li><div class="src-line">&nbsp;</div></li>
<li><div class="src-line">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-comm">//&nbsp;Render&nbsp;even_numbers.tpl&nbsp;template&nbsp;and&nbsp;put&nbsp;it&nbsp;in&nbsp;&quot;result&quot;&nbsp;smarty&nbsp;value</span></div></li>
<li><div class="src-line">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">function&nbsp;</span><span class="src-id">even_numbers</span><span class="src-sym">(</span><span class="src-sym">)</span><span class="src-sym">{</span></div></li>
<li><div class="src-line">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$rendered_result&nbsp;</span>=&nbsp;<span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-var">psa_smarty</span><span class="src-sym">-&gt;</span><span class="src-id">fetch</span><span class="src-sym">(</span><span class="src-str">&quot;example_app/even_numbers.tpl&quot;</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
<li><div class="src-line">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-var">psa_smarty</span><span class="src-sym">-&gt;</span><span class="src-id">assign</span><span class="src-sym">(</span><span class="src-str">&quot;result&quot;</span><span class="src-sym">,&nbsp;</span><span class="src-var">$rendered_result</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
<li><div class="src-line">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">}</span></div></li>
<li><div class="src-line">&nbsp;</div></li>
<li><div class="src-line">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-comm">//&nbsp;Main&nbsp;template&nbsp;render&nbsp;and&nbsp;display&nbsp;method.</span></div></li>
<li><div class="src-line">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-comm">//&nbsp;Every&nbsp;application&nbsp;should&nbsp;have&nbsp;one&nbsp;method&nbsp;like&nbsp;this&nbsp;for&nbsp;one&nbsp;controller.</span></div></li>
<li><div class="src-line">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-comm">//&nbsp;This&nbsp;method&nbsp;should&nbsp;determine&nbsp;if&nbsp;request&nbsp;is&nbsp;made&nbsp;by&nbsp;ajax&nbsp;or&nbsp;not&nbsp;and&nbsp;echo&nbsp;only</span></div></li>
<li><div class="src-line">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-comm">//&nbsp;ajax&nbsp;result&nbsp;or&nbsp;whole&nbsp;html&nbsp;page.</span></div></li>
<li><div class="src-line">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">function&nbsp;</span><span class="src-id">generate_html</span><span class="src-sym">(</span><span class="src-sym">)</span><span class="src-sym">{</span></div></li>
<li><div class="src-line">&nbsp;</div></li>
<li><div class="src-line">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$rendered_menu&nbsp;</span>=&nbsp;<span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-var">psa_smarty</span><span class="src-sym">-&gt;</span><span class="src-id">fetch</span><span class="src-sym">(</span><span class="src-str">&quot;example_app/menu.tpl&quot;</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
<li><div class="src-line">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$rendered_header&nbsp;</span>=&nbsp;<span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-var">psa_smarty</span><span class="src-sym">-&gt;</span><span class="src-id">fetch</span><span class="src-sym">(</span><span class="src-str">&quot;example_app/header.tpl&quot;</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
<li><div class="src-line">&nbsp;</div></li>
<li><div class="src-line">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-var">psa_smarty</span><span class="src-sym">-&gt;</span><span class="src-id">assign</span><span class="src-sym">(</span><span class="src-str">&quot;header&quot;</span><span class="src-sym">,&nbsp;</span><span class="src-var">$rendered_header</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
<li><div class="src-line">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-var">psa_smarty</span><span class="src-sym">-&gt;</span><span class="src-id">assign</span><span class="src-sym">(</span><span class="src-str">&quot;menu&quot;</span><span class="src-sym">,&nbsp;</span><span class="src-var">$rendered_menu</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
<li><div class="src-line">&nbsp;</div></li>
<li><div class="src-line">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;echo&nbsp;<span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-var">psa_smarty</span><span class="src-sym">-&gt;</span><span class="src-id">fetch</span><span class="src-sym">(</span><span class="src-str">&quot;example_app/main.tpl&quot;</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
<li><div class="src-line">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">}</span></div></li>
<li><div class="src-line">&nbsp;<span class="src-sym">}</span></div></li>
<li><div class="src-line">&nbsp;<span class="src-php">?&gt;</span></div></li>
</ol></div></p></p>
	<ul class="tags">
				<li><span class="field">see:</span> <a href="../../psa/plugins/Psa_Plugin_Controller.html">Psa_Plugin_Controller</a></li>
				<li><span class="field">see:</span> <a href="../../psa/plugins/Psa_Plugin_Model.html">Psa_Plugin_Model</a></li>
				<li><span class="field">abstract:</span> </li>
			</ul>
		<p class="notes">
			Located in <a class="field" href="_plugin_classes---Psa_Plugin_View.class.php.html">/plugin_classes/Psa_Plugin_View.class.php</a> (line <span class="field"><a href="../../__filesource/fsource_psa_plugins_plugin_classesPsa_Plugin_View.class.php.html#a71">71</a></span>)
		</p>
		
				
		<pre></pre>
	
			</div>
</div>



	<a name="sec-var-summary"></a>
	<div class="info-box">
		<div class="info-box-title">Variable Summary</span></div>
		<div class="nav-bar">
			<a href="#sec-description">Description</a> |
						<span class="disabled">Vars</span> (<a href="#sec-vars">details</a>)
							| 
									<a href="#sec-method-summary">Methods</a> (<a href="#sec-methods">details</a>)
							
								</div>
		<div class="info-box-body">
			<div class="var-summary">
																																																<div class="var-title">
					<img src="../../media/images/Variable.png" alt=" " />
					<span class="var-type"><a href="../../psa/Psa_Dully.html">Psa_Dully</a></span>
					<a href="#$psa_dully" title="details" class="var-name">$psa_dully</a>
				</div>
																<div class="var-title">
					<img src="../../media/images/Variable.png" alt=" " />
					<span class="var-type"><a href="../../psa/Psa_Registry.html">Psa_Registry</a></span>
					<a href="#$psa_registry" title="details" class="var-name">$psa_registry</a>
				</div>
																<div class="var-title">
					<img src="../../media/images/Variable.png" alt=" " />
					<span class="var-type"><a href="../../psa/Psa_Result.html">Psa_Result</a></span>
					<a href="#$psa_result" title="details" class="var-name">$psa_result</a>
				</div>
																<div class="var-title">
					<img src="../../media/images/Variable.png" alt=" " />
					<span class="var-type"><a href="../../psa/Psa_Smarty.html">Psa_Smarty</a></span>
					<a href="#$psa_smarty" title="details" class="var-name">$psa_smarty</a>
				</div>
											</div>
		</div>
	</div>

	<a name="sec-method-summary"></a>
	<div class="info-box">
		<div class="info-box-title">Method Summary</span></div>
		<div class="nav-bar">
			<a href="#sec-description">Description</a> |
																		<a href="#sec-var-summary">Vars</a> (<a href="#sec-vars">details</a>)
				 
				|
						<span class="disabled">Methods</span> (<a href="#sec-methods">details</a>)
		</div>
		<div class="info-box-body">			
			<div class="method-summary">
																								<div class="method-definition">
					<img src="../../media/images/Constructor.png" alt=" "/>
											<span class="method-result">Psa_Plugin_View</span>
										<a href="#__construct" title="details" class="method-name">__construct</a>
										()
									</div>
											</div>
		</div>
	</div>		

	<a name="sec-vars"></a>
	<div class="info-box">
		<div class="info-box-title">Variables</div>
		<div class="nav-bar">
			<a href="#sec-description">Description</a> |
										<a href="#sec-var-summary">Vars</a> (<span class="disabled">details</span>)
						
			
										| 
									<a href="#sec-method-summary">Methods</a> (<a href="#sec-methods">details</a>)
							
					</div>
		<div class="info-box-body">
			
<a name="var$psa_dully" id="$psa_dully"><!-- --></A>
<div class="oddrow">

	<div class="var-header">
		<img src="../../media/images/Variable.png" />
		<span class="var-title">
			<span class="var-type"><a href="../../psa/Psa_Dully.html">Psa_Dully</a></span>
			<span class="var-name">$psa_dully</span>
						(line <span class="line-number"><a href="../../__filesource/fsource_psa_plugins_plugin_classesPsa_Plugin_View.class.php.html#a98">98</a></span>)
		</span>
	</div>

	<!-- ========== Info from phpDoc block ========= -->
<p class="short-description">Reference to Dully template engine object.</p>
<p class="description"><p>It is set if Dully object is instanced by psa_use_dully() method in controller plugin before  calling view plugins.</p></p>
	<ul class="tags">
				<li><span class="field">see:</span> psa_use_dully()</li>
				<li><span class="field">see:</span> <a href="../../psa/_scripts---Psa_Dully.class.php.html">Psa_Dully.class.php</a></li>
				<li><span class="field">access:</span> public</li>
			</ul>
	
	
		
		

</div>
<a name="var$psa_registry" id="$psa_registry"><!-- --></A>
<div class="evenrow">

	<div class="var-header">
		<img src="../../media/images/Variable.png" />
		<span class="var-title">
			<span class="var-type"><a href="../../psa/Psa_Registry.html">Psa_Registry</a></span>
			<span class="var-name">$psa_registry</span>
						(line <span class="line-number"><a href="../../__filesource/fsource_psa_plugins_plugin_classesPsa_Plugin_View.class.php.html#a105">105</a></span>)
		</span>
	</div>

	<!-- ========== Info from phpDoc block ========= -->
<p class="short-description">Reference to registry object</p>
	<ul class="tags">
				<li><span class="field">access:</span> public</li>
			</ul>
	
	
		
		

</div>
<a name="var$psa_result" id="$psa_result"><!-- --></A>
<div class="oddrow">

	<div class="var-header">
		<img src="../../media/images/Variable.png" />
		<span class="var-title">
			<span class="var-type"><a href="../../psa/Psa_Result.html">Psa_Result</a></span>
			<span class="var-name">$psa_result</span>
						(line <span class="line-number"><a href="../../__filesource/fsource_psa_plugins_plugin_classesPsa_Plugin_View.class.php.html#a77">77</a></span>)
		</span>
	</div>

	<!-- ========== Info from phpDoc block ========= -->
<p class="short-description">Reference to result object</p>
	<ul class="tags">
				<li><span class="field">access:</span> public</li>
			</ul>
	
	
		
		

</div>
<a name="var$psa_smarty" id="$psa_smarty"><!-- --></A>
<div class="evenrow">

	<div class="var-header">
		<img src="../../media/images/Variable.png" />
		<span class="var-title">
			<span class="var-type"><a href="../../psa/Psa_Smarty.html">Psa_Smarty</a></span>
			<span class="var-name">$psa_smarty</span>
						(line <span class="line-number"><a href="../../__filesource/fsource_psa_plugins_plugin_classesPsa_Plugin_View.class.php.html#a87">87</a></span>)
		</span>
	</div>

	<!-- ========== Info from phpDoc block ========= -->
<p class="short-description">Reference to Smarty template engine object.</p>
<p class="description"><p>It is set if Smarty object is instanced by psa_use_smarty() method in controller plugin before  calling view plugins.</p></p>
	<ul class="tags">
				<li><span class="field">see:</span> psa_use_smarty()</li>
				<li><span class="field">access:</span> public</li>
			</ul>
	
	
		
		

</div>
						
		</div>
	</div>
	
	<a name="sec-methods"></a>
	<div class="info-box">
		<div class="info-box-title">Methods</div>
		<div class="nav-bar">
			<a href="#sec-description">Description</a> |
															<a href="#sec-var-summary">Vars</a> (<a href="#sec-vars">details</a>)
														<a href="#sec-method-summary">Methods</a> (<span class="disabled">details</span>)
						
		</div>
		<div class="info-box-body">
			<A NAME='method_detail'></A>
<a name="method__construct" id="__construct"><!-- --></a>
<div class="oddrow">
	
	<div class="method-header">
		<img src="../../media/images/Constructor.png" />
		<span class="method-title">Constructor __construct</span> (line <span class="line-number"><a href="../../__filesource/fsource_psa_plugins_plugin_classesPsa_Plugin_View.class.php.html#a111">111</a></span>)
	</div> 
	
	<!-- ========== Info from phpDoc block ========= -->
<p class="short-description">Constructor. Sets some object references.</p>
	
	<div class="method-signature">
		<span class="method-result">Psa_Plugin_View</span>
		<span class="method-name">
			__construct
		</span>
				()
			</div>
	
		
			
	</div>
						
		</div>
	</div>

	
	<p class="notes" id="credit">
		Documentation generated on Thu, 21 Oct 2010 01:40:54 +0200 by <a href="http://www.phpdoc.org" target="_blank">phpDocumentor 1.4.3</a>
	</p>
	</div></body>
</html>